package com.hunan.api.catv.service.impl.news;

import com.hunan.api.catv.dao.BaseDao;
import com.hunan.api.catv.dao.NewsDao;
import com.hunan.api.catv.entity.po.News;
import com.hunan.api.catv.entity.vo.NewsVo;
import com.hunan.api.catv.service.impl.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资讯管理
 */
@Service
public class NewsService extends CommonService<News, NewsVo, Integer> {

    @Autowired
    public NewsDao newsDao;

    @Override
    public BaseDao<News, NewsVo, Integer> getBaseDao() {
        return newsDao;
    }

    public Integer incrCount(News news) {
        return newsDao.incrCount(news);
    }

    public Integer decrCount(News news) {
        return newsDao.decrCount(news);
    }

    public Integer totalNum(Integer columnId) {
        return newsDao.totalNum(columnId);
    }

    public List<Integer> listIdsForPGC(News news) {
        return newsDao.listIdsForPGC(news);
    }

    public List<Integer> getUgcListById(Integer columnId, Long dateTime) {
        return newsDao.getUgcListById(columnId, dateTime);
    }

    public List<Integer> newsIdList(Integer columnId) {
        return newsDao.newsIdList(columnId);
    }

    public News getNewsInfoByFileId(String fileId) {
        return newsDao.getNewsInfoByFileId(fileId);
    }

    public void updateNewUrl(News news) {
        newsDao.updateNewUrl(news);
    }
}
